package net.javlov.example.cont;

import net.javlov.Action;
import net.javlov.Agent;
import net.javlov.LearningRate;
import net.javlov.Policy;
import net.javlov.State;
import net.javlov.StateOptionMapper;

public class StateEncoder implements Agent {
	
	StateOptionMapper coder;
	Agent a;
	
	public StateEncoder(StateOptionMapper m, Agent agnt) {
		coder = m;
		a = agnt;
	}
	
	@Override
	public Action doStep(State s, double reward) {
		return a.doStep(coder.map(s), reward);
	}
	@Override
	public Action firstStep(State s) {
		return a.firstStep(coder.map(s));
	}
	@Override
	public LearningRate getLearnRate() {
		return a.getLearnRate();
	}
	@Override
	public Policy getPolicy() {
		return a.getPolicy();
	}
	@Override
	public void init() {
		a.init();		
	}
	@Override
	public void reset() {
		a.reset();		
	}
	@Override
	public void setLearnRate(LearningRate rate) {
		a.setLearnRate(rate);
	}
	@Override
	public void setPolicy(Policy p) {
		a.setPolicy(p);		
	}
	
}
